<template>
  <div>
    <!-- 顶部滑动条  -->
    <div id="slider" class="mui-slider">
      <div
        id="sliderSegmentedControl"
        class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
        <div class="mui-scroll">
          <a
            :class="['mui-control-item', item.id == 0 ? 'mui-active':'']"
            v-for="item in cate"
            :key="item.id"
          >{{item.title}}</a>
        </div>
      </div>
    </div>

    <!-- 图片列表区域 -->
    <!-- 图片列表区域 -->
    <ul class="photo-list">
      <router-link v-for="item in list" :key="item.id" :to="'/home/photoinfo/' + item.id" tag="li">
        <img v-lazy="item.img_url">
        <div class="info">
          <h1 class="info-title">{{ item.title }}</h1>
          <div class="info-body">{{ item.zhaiyao }}</div>
        </div>
      </router-link>
    </ul>
  </div>
</template>
<script>
import mui from "../../lib/mui/js/mui.min.js";
import { Toast } from "mint-ui";
export default {
  data() {
    return {
      list: [
        {
          id: 50,
          title: "asjhjhdjhsdajdka是的法师法撒撒爱上谁打开空间大健康",
          img_url:
            "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2926123936,650428011&fm=26&gp=0.jpg",
          zhaiyao:
            "等级考试是开放式空间即可顺风车几十年开发农村是尽可能圣诞节开发从纳斯达克女方家考试呢是会计师那大V几十年的金额是是大V能升级恶女角色"
        },
        {
          id: 51,
          title: "asjhjhdjhsdajdka是的法师法撒撒爱上谁打开空间大健康",
          img_url:
            "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2926123936,650428011&fm=26&gp=0.jpg",
          zhaiyao:
            "等级考试是开放式空间即可顺风车几十年开发农村是尽可能圣诞节开发从纳斯达克女方家考试呢是会计师那大V几十年的金额是是大V能升级恶女角色"
        },
        {
          id: 52,
          title: "asjhjhdjhsdajdka是的法师法撒撒爱上谁打开空间大健康",
          img_url:
            "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2926123936,650428011&fm=26&gp=0.jpg",
          zhaiyao:
            "等级考试是开放式空间即可ewewwe播放风帆股份地方地方大幅度地方地方大幅度发送到发送到发生顺风车几十年开发农村是尽可能圣诞节开发从纳斯达克女方家考试呢是会计师那大V几十年的金额是是大V能升级恶女角色"
        },
        {
          id: 53,
          title: "asjhjhdjhsdajdka是的法师法撒撒爱上谁打开空间大健康",
          img_url:
            "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2926123936,650428011&fm=26&gp=0.jpg",
          zhaiyao:
            "等级考试是开放式空间即可顺风车几十年开发农村是尽可能圣诞节开发从纳斯达克女方家考试呢是会计师那大V几十年的金额是是大V能升级恶女角色"
        },
        {
          id: 54,
          title: "asjhjhdjhsdajdka是的法师法撒撒爱上谁打开空间大健康",
          img_url:
            "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2926123936,650428011&fm=26&gp=0.jpg",
          zhaiyao:
            "等级考试是开放式空间即可顺风车几十年开发农村是尽可能圣诞节开发从纳斯达克女方家考试呢是会计师那大V几十年的金额是是大V能升级恶女角色"
        },
        {
          id: 55,
          title: "asjhjhdjhsdajdka是的法师法撒撒爱上谁打开空间大健康",
          img_url:
            "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2926123936,650428011&fm=26&gp=0.jpg",
          zhaiyao:
            "等级考试是开放式空间即可顺风车几十年开发农村是尽可能圣诞节开发从纳斯达克女方家考试呢是会计师那大V几十年的金额是是大V能升级恶女角色"
        },
        {
          id: 56,
          title: "asjhjhdjhsdajdka是的法师法撒撒爱上谁打开空间大健康",
          img_url:
            "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2926123936,650428011&fm=26&gp=0.jpg",
          zhaiyao:
            "等级考试是开放式空间即可顺风车几十年开发农村是尽可能圣诞节开发从纳斯达克女方家考试呢是会计师那大V几十年的金额是是大V能升级恶女角色"
        }
      ],
      cate: [
        {
          title: "全部",
          id: 0
        },
        {
          title: "家居生活",
          id: 14
        },
        {
          title: "科技",
          id: 2
        },
        {
          title: "生活",
          id: 3
        },
        {
          title: "养生",
          id: 4
        },
        {
          title: "养生",
          id: 5
        }
      ]
    };
  },
  created() {
    // this.getAllCategory();
  },
  mounted() {
    mui(".mui-scroll-wrapper").scroll({
      deceleration: 0.0005 //flick 减速系数，系数越大，滚动速度越慢，滚动距离越小，默认值0.0006
    });
  },
  methods: {
    getAllCategory() {
      this.$http.get("api/getimgcategory").then(res => {
        if (res.body.status === 0) {
        } else {
          Toast("请求分类失败");
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
* {
  touch-action: pan-y;
}

.photo-list {
    list-style: none;
    margin: 0;
    padding: 10px;
    padding-bottom: 0;
  li {
      background-color: #ccc;
      text-align: center;
      margin-bottom: 10px;
      box-shadow: 0 0 9px #ccc;
      position: relative;
      img{
          width: 100%;
          vertical-align: middle;
      }
    img[lazy="loading"] {
      width: 40px;
      height: 300px;
      margin: auto;
    }
    .info{
        position: absolute;
        bottom: 0px;
        background-color: rgba(0,0,0,.4);
        max-height: 84px;
        color: #fff;
        text-align: left;
        .info-title{
            font-size: 14px;
        }
        .info-body{
            font-size: 13px;
        }
    }
  }
}
</style>
